package com.freecat.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {

    private static final String DATABASE_NAME = "gpstest.db";  //数据库名字
    private static final int DATABASE_VERSION = 1 ;         //数据库版本号

    public DBHelper(Context context){


        super(context,DATABASE_NAME,null,DATABASE_VERSION);
    }




    String resevermessage_table="gpsaddress";

    /*
    *
    * GPS地址表
    * 主键ID
    * 坐标地址
    * 火星坐标 gj02
    *
    * 百度坐标 baidu09
    *
    * time 记录时间
    * glat
    * glon
    * blat
    * blon
    *
    *
    * */

    /*
    * id INTEGER PRIMARY KEY AUTOINCREMENT,
    * xfsbh TEXT,
    * address TEXT,
    * TIME TEXT,
    * glat TEXT,
    * glon TEXT,
    * blat TEXT,
    * blon TEXT,
    * Status TEXT,
    * locx TEXT,
    * locy TEXT,
    * hight TEXT,
    * place TEXT,
    * sdcskjkgg TEXT,
    * gwzj TEXT,
    * gwyl TEXT,
    * gwxs TEXT,
    * kyzt TEXT,
    * jdmc TEXT,
    * wzms TEXT,
    * bz TEXT
    * */
    String creat_table_reseverpark="CREATE TABLE IF NOT EXISTS "+resevermessage_table+"(id INTEGER PRIMARY KEY AUTOINCREMENT, xfsbh TEXT,address TEXT,TIME TEXT,glat TEXT,glon TEXT,blat TEXT,blon TEXT,Status TEXT,locx TEXT,locy TEXT,hight TEXT,place TEXT,sdcskjkgg TEXT,gwzj TEXT,gwyl TEXT,gwxs TEXT,kyzt TEXT,jdmc TEXT,wzms TEXT,bz TEXT)";

    /**
     * 创建数据库表：person
     * _id为主键，自增
     * **/
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        Log.i("TAG:","创建数据库！");
        sqLiteDatabase.execSQL(creat_table_reseverpark);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {

    }

    @Override
    public void onOpen(SQLiteDatabase sqLiteDatabase){
        super.onOpen(sqLiteDatabase);
    }
}
